<?xml version="1.0" encoding="utf-8"?>

<EFFECT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns ="urn:dsfx0">  

  <DST_STATE_GROUP>
    <NAME>DepthEnableWriteLess</NAME>
    <DEPTH_ENABLE>true</DEPTH_ENABLE>
    <DEPTH_WRITE>true</DEPTH_WRITE>
    <!-- Use less for Z test -->
    <DEPTH_FUNC>Less</DEPTH_FUNC>
    <STENCIL_ENABLE>false</STENCIL_ENABLE>
  </DST_STATE_GROUP>
  
  <BLEND_STATE_GROUP>
    <NAME>NoBlend</NAME>
    <SEPARATE_BLEND>false</SEPARATE_BLEND>
    <TARGET>
      <ID>0</ID>
      <BLEND_ENABLE>false</BLEND_ENABLE>
    </TARGET>
  </BLEND_STATE_GROUP>

  <RAST_STATE_GROUP>
    <NAME>Volume</NAME>
    <FILL_MODE>Solid</FILL_MODE>
    <CULL_MODE>Back</CULL_MODE>
    <IS_FRONT_CCW>true</IS_FRONT_CCW>
    <DEPTH_BIAS>1</DEPTH_BIAS>
    <DEPTH_SLOPE_FACTOR>1.1</DEPTH_SLOPE_FACTOR>
  </RAST_STATE_GROUP>

  <CONSTANT_BUFFER>
    <NAME>cbPostEffect_Main_Auto</NAME>
  </CONSTANT_BUFFER>
 
  <SAMPLER>
    <NAME>s_DataMap</NAME>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>usampler2D</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>Capping</SAMPLER_OPTION_GRAMMAR>
    </SAMPLER_DECLARATION>
  </SAMPLER>
  
  <SAMPLER>
    <NAME>s_ColorMap</NAME>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>usampler2D</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>Capping</SAMPLER_OPTION_GRAMMAR>
    </SAMPLER_DECLARATION>
  </SAMPLER>
  
  <SAMPLER>
    <NAME>s_NormalMap</NAME>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>usampler2D</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>Capping</SAMPLER_OPTION_GRAMMAR>
    </SAMPLER_DECLARATION>
  </SAMPLER>
  
  <!-- unused, but needed otherwise PostEffect_ZMap_DeclarePS will not compile -->
  <SAMPLER>
    <EXTERNAL_NAME>s_ZMap</EXTERNAL_NAME>
  </SAMPLER>

  <SAMPLER_STATE>
    <NAME>SamplerNearest</NAME>
    <MAG_FILTER>Nearest</MAG_FILTER>
    <MIN_FILTER>Nearest</MIN_FILTER>
    <MIP_FILTER>None</MIP_FILTER>
    <WRAP_U>ClampToEdge</WRAP_U>
    <WRAP_V>ClampToEdge</WRAP_V>
  </SAMPLER_STATE>

  <TECHNIQUE>
    <NAME>PostProcess</NAME>
    <PASS>
      <NAME>Pass0</NAME>
  
      <SAMPLER_ASSIGNMENT_LIST>
        <SAMPLER_ASSIGNMENT><SAMPLER>s_DataMap</SAMPLER><STATES>SamplerNearest</STATES></SAMPLER_ASSIGNMENT>
        <SAMPLER_ASSIGNMENT><SAMPLER>s_ColorMap</SAMPLER><STATES>SamplerNearest</STATES></SAMPLER_ASSIGNMENT>
        <SAMPLER_ASSIGNMENT><SAMPLER>s_NormalMap</SAMPLER><STATES>SamplerNearest</STATES></SAMPLER_ASSIGNMENT>
      </SAMPLER_ASSIGNMENT_LIST>
      
      <STREAMS>
        <STREAM>
          <STAGES>Vertex_Fragment</STAGES>
          <VARYING>
            <NAME>vTexCoord</NAME>
            <TYPE>float2</TYPE>
            <QUALIFIER>smooth</QUALIFIER>
          </VARYING>
        </STREAM>
      </STREAMS>

      <SHADER_OPTIONS>
        <SHADER_OPTION>
          <NAME>NeedUVs</NAME>
          <OPTION_VALUE>1</OPTION_VALUE>
        </SHADER_OPTION>
        <SHADER_OPTION>
          <NAME>TexCoordAsVec2</NAME>
          <OPTION_VALUE>1</OPTION_VALUE>
        </SHADER_OPTION>
      </SHADER_OPTIONS>

      <DEPTH_STENCIL_STATE>DepthEnableWriteLess</DEPTH_STENCIL_STATE>
      <RASTERIZER_STATE>Volume</RASTERIZER_STATE>
      <COMMONS>streams varyings</COMMONS>
      <VERTEX_STAGE>PostEffect_FullScreenQuadVS</VERTEX_STAGE>
      <FRAGMENT_STAGE>PostEffect_DeclarePS PostEffect_Texture_Helpers PostEffect_ZMap_DeclarePS CappingCommons PostEffect_Capping</FRAGMENT_STAGE>
    </PASS>
  </TECHNIQUE>

</EFFECT>
